<?php
namespace app\model\admin;

use think\Db;

class Friendlink
{
    //获取友情链接列表
    public function get_friendlink_lists($where,$sort='',$paginate=10)
    {
        $result_lists = Db::name('friendly_link')->where($where)->order($sort)->paginate($paginate);
        return $result_lists;
    }

    //友情链接详情
    public function friendlink_detail($advert_id){
        $result = Db::name('friendly_link')->where('id',$advert_id)->find();
        return $result;
    }

    //友情链接添加
    public function add_friendlink($data){
        $status = Db::name('friendly_link')->insert($data);
        return $status;
    }

    //友情链接修改
    public function update_friendlink($where,$data){
        $status = Db::name('friendly_link')->where($where)->update($data);
        return $status;
    }

    //友情链接删除
    public function delete_friendlink($array_id){
        $advert_delete = Db::name('friendly_link')->delete($array_id);
        return $advert_delete;
    }

}


